package main.states;



import java.util.ArrayList;

import main.entities.Entity;
import main.entities.EntityFactory;
import main.entities.EntityPlayer;
import main.tileMap.Planet;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.BasicGameState;
import org.newdawn.slick.state.StateBasedGame;

public class Play extends BasicGameState{
	
	public ArrayList<Planet> planets;
	public Planet currentPlanet;
	public Entity player;
	private EntityFactory eFactory;
	
	
	public Play(int state) throws SlickException{
		super();
		eFactory = new EntityFactory();
		currentPlanet = new Planet("pMadre");
	}

	@Override
	public void init(GameContainer gc, StateBasedGame sbg)
			throws SlickException {
		//Planeta

		currentPlanet.init(gc,sbg,eFactory);

		
	}


	@Override
	public void render(GameContainer gc, StateBasedGame sbg, Graphics g)
			throws SlickException {
		currentPlanet.render(gc,sbg,g);

		
	}

	@Override
	public void update(GameContainer gc, StateBasedGame sbg, int g)
			throws SlickException {
		currentPlanet.update(gc,sbg,g);
		sbg.inputStarted();
		
	}
	


	@Override
	public int getID() {
		return 1;
	}
	@Override
	public void keyPressed(int key,char c){
		currentPlanet.keyPressed(key, c);
	}
	@Override
	public void keyReleased(int key,char c){
		currentPlanet.keyReleased(key, c);
	}

}
